﻿// © 2005 IDesign Inc. All rights reserved 
//Questions? Comments? go to 
//http://www.idesign.net

using System;
using System.Web.Services;
using System.EnterpriseServices;

[WebServiceBinding("IPasswordManager")]
interface IPasswordManager
{
   [WebMethod(Description="Gets a value indicating whether the current membership provider is configured to allow users to reset their passwords. Returns true if the membership provider supports password reset; otherwise false.")]
   bool EnablePasswordReset(string application);

   [WebMethod(Description="Gets a value indicating whether the current membership provider is configured to allow users to retrieve their passwords. Returns true if the membership provider supports password retrieval; otherwise false.")]
   bool EnablePasswordRetrieval(string application);

   [WebMethod(Description="Geenrates a password according to the regular expression and other restrictions")]
   string GeneratePassword(string application,int length,int numberOfNonAlphanumericCharacters);

   [WebMethod(Description="Returns the maximum allowed of password retries before locking out the user")]
   int GetMaxInvalidPasswordAttempts(string application);

   [WebMethod(Description="Returns the minimum required number of non alphanumeric characters")]
   int GetMinRequiredNonAlphanumericCharacters(string application);

   [WebMethod(Description="Returns the minimum required password length")]
   int GetMinRequiredPasswordLength(string application);

   [WebMethod(Description="Gets the number of minutes in which a maximum number of invalid password or password answer attempts are allowed before the membership user is locked out.")]
   int GetPasswordAttemptWindow(string application);

   [WebMethod(Description="Returns the regular expression for the password")]
   string GetPasswordStrengthRegularExpression(string application);

   [WebMethod(Description="Gets a value indicating whether the default membership provider requires the user to answer a password question for password reset and retrieval.")]
   bool RequiresQuestionAndAnswer(string application);

   [WebMethod(Description="Resets a user's password to a new, automatically generated password. Returns the new password for the membership user. Requires the application configuration file to not require password answer",TransactionOption=TransactionOption.RequiresNew)]
   string ResetPassword(string application,string userName);

   [WebMethod(Description="Resets a user's password to a new, automatically generated password. Returns the new password for the membership user. Requires the password answer",TransactionOption=TransactionOption.RequiresNew)]
   string ResetPasswordWithQuestionAndAnswer(string application,string userName,string passwordAnswer);

   [WebMethod(Description="Gets the password for the membership user from the membership data store. Requires the password answer for the membership user",TransactionOption=TransactionOption.RequiresNew)]
   string GetPassword(string application,string userName,string passwordAnswer);

   [WebMethod(Description="Gets the password question for the user.",TransactionOption=TransactionOption.RequiresNew)]
   string GetPasswordQuestion(string application,string userName);

   [WebMethod(Description="Updates the password for the membership user in the membership data store. Returns true if the update was successful; otherwise, false. Requires the application configuration file to not require password answer",TransactionOption=TransactionOption.RequiresNew)]
   void ChangePassword(string application,string userName,string newPassword);

   [WebMethod(Description="Updates the password for the membership user in the membership data store. Returns true if the update was successful; otherwise, false.",TransactionOption=TransactionOption.RequiresNew)]
   void ChangePasswordWithAnswer(string application,string userName,string passwordAnswer,string newPassword);
}
